<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <title>Image Collector</title>
    <style>
        html, body {
            height: 100%;
            margin: 0;
            padding: 0;
            overflow: hidden;
            font-family: Arial, sans-serif;
        }

        body {
            background-color: #f7f1e3;
            display: flex;
            flex-direction: column;
        }

        .controls {
            padding: 10px;
            background-color: #fff;
            border-radius: 8px;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
            margin: 10px;
            z-index: 10; /* 确保controls在所有元素之上 */
        }

        button {
            display: inline-block;
            margin: 5px;
            padding: 8px 12px;
            border: none;
            background-color: #007BFF;
            color: white;
            font-size: 14px;
            border-radius: 5px;
            cursor: pointer;
            transition: background-color 0.3s ease, transform 0.2s ease;
        }

        button:hover {
            background-color: #0056b3;
            transform: scale(1.05);
        }

        #images {
            flex: 1;
            overflow-y: auto;
            padding: 10px;
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
            justify-content: center;
            box-sizing: border-box;
        }

        .image-item {
            position: relative;
            cursor: pointer;
            transition: transform 0.3s ease, box-shadow 0.3s ease;
            border-radius: 5px;
            overflow: hidden;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
            width: 100%;
            max-width: 200px; /* 控制图片最大宽度，依据你的设计需要调整 */
        }

        .image-item:hover {
            transform: scale(1.02);
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
        }

        .image-item.selected {
            box-shadow: 0 0 0 3px #4CAF50;
        }

        .resolution {
            position: absolute;
            top: 5px;
            right: 5px;
            background-color: rgba(0, 0, 0, 0.5);
            color: white;
            padding: 2px 5px;
            font-size: 12px;
            border-radius: 3px;
        }

        img {
            width: 100%;
            display: block;
        }

        /* 针对 Chrome, Safari, Edge, Opera */
        input[type="number"]::-webkit-outer-spin-button,
        input[type="number"]::-webkit-inner-spin-button {
            -webkit-appearance: none;
            margin: 0;
        }

        /* 针对 Firefox */
        input[type="number"] {
            -moz-appearance: textfield;
        }

    </style>
</head>
<body>
<div class="controls">
    <label>筛选宽度:</label>
    <input type="number" id="minWidth" placeholder="最小宽度" style="width: 60px;">
    <input type="number" id="maxWidth" placeholder="最大宽度" style="width: 60px;">
    <br>
    <label>筛选高度:</label>
    <input type="number" id="minHeight" placeholder="最小高度" style="width: 60px;">
    <input type="number" id="maxHeight" placeholder="最大高度" style="width: 60px;">
    <br>
    <button id="applyFilter">应用</button>
    <button id="refreshImages">重新抓取</button>
</div>
<div class="controls">
    <button id="selectAll">全选</button>
    <button id="deselectAll">取消全选</button>
    <button id="downloadSelected">下载选中图片</button>
</div>
<div id="images" class="image-container"></div>
<script src="./sidebar.js"></script>
</body>
</html>
